<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./node_modules/socket.io-client/dist/socket.io.js"></script>
    <script type="text/javascript">
        var socket = io.connect('http://localhost:3000');
        socket.on('notice', function(info) {
            console.log('这是来自服务端的消息：' + info);
        });
        socket.emit("sendMsg", data);
    </script>

</body>

</html>